﻿using System;

namespace MediatorPattern.DemoTwo
{
    /// <summary>
    /// 銷售管理類
    /// </summary>
    public class Sale : AbstractColleague
    {
        public Sale(AbstractMediator _mediator) : base(_mediator)
        {
        }

        /// <summary>
        /// 銷售IBM電腦
        /// </summary>
        /// <param name="number"></param>
        public void sellIBMComputer(int number)
        {
            mediator.execute("sale.sell", number);
        }

        /// <summary>
        /// 反饋銷售情況
        /// </summary>
        /// <returns></returns>
        public int getSaleStatus()
        {
            Random rand = new Random();
            int saleStatus = rand.Next(100);

            return saleStatus;
        }

        /// <summary>
        /// 折價處理
        /// </summary>
        public void offSale()
        {

        }
    }
}